Post build events are very important in VSTA (versions 1 and 2). They are used to install files in the GAC, organize DLL's for add-in discovery, and in VSTA v 2, to rebuild the pipeline. Here are the files used in post build events by the ShapeApp samples, the commands which run them, and some information...
Overview: During development, changes may need to be made to the proxy. Anytime the proxy is changed its assembly needs to be re-installed in the GAC. Failing to do this will result in the last version installed in the GAC to be used by VSTA and the error "The following module was built either with optimizations...
Back in October 2003, Ted Pattison wrote a good MSDN MAgazine article exploring options for deploying assembly DLLs in both development and production environments. http://msdn.microsoft.com/msdnmag/issues/03/10/BasicInstincts/