Download and read carefully though the ObjectDock SDK. It should tell you how the docklets work, how to make them, etc. You can also look at existing examples such as the Weather docklet.
http://storage.stardock.com/files/ObjectDock_Docklet_SDK_v0.99a.zip