Hows do you learn to start writing Unity plugins?
An introductionary guide can be found over here, and you can always check the docs on the editor class. You can also find some examples in the asset store for free, and there's a bit of documantation on it on both the forum and this site. But all that aside it seems there isn't actually a good guide out there to walk you through an example project, which is a shame.
Good luck with it!