nitinumap,
This depends on which version of VSTA you are using. For both versions of VSTA the SDKs include a sample and walk through.
Samples:
VSTA v 1- ShapeAppAdvancedCSharp, ShapeAppAdvancedMFC
VSTA v 2- ShapeAppMacroRecordingCSharp
If you would prefer these samples in Visual Basic check out our
VSTASamples section under Downloads.
Thanks,
-Melody