My plugin is open-source (released under the GPL license) so you could use it as a guide to writing a plugin. The source can be found here:
http://sourceforge.net/project/showfiles.php?group_id=121315
Good luck with it! I've written the project in Visual Studio .NET 2003, but the .cpp files can be compiled with Visual Studio C++ 5 under a new project.