With DemoView plugin you can easily understand the basic viewer plugin concept and start writing your own viewer plugin.
See Using Plugins for a description of basic work with plugin viewer, thumbnail loader and menu extension.