How to write an IntelliJ IDEA Plugin?
There is a Creating Your First Plugin guide on JetBrains web site. It covers all the needed steps from plugin creation to deployment to the plugin repository.
You might also want take a look in the source code of a simple plugin like Twitter Integration Plugin which I recently implemented. Or check a more complex one like this one.
Check the documentation and the source code of the other plug-ins available in the public git repository of the Community Edition.