NOTE: I have not finished this post but my blogging engine does not support drafts apparently. Take it as it is:

Often I have the need to do a task before or after my build.
i.e.
1. uninstall then reinstall a com+ component
2. run unit tests
3. start another program

The main one I use is the com component and here are the steps for creating this:
1. Add a new "Makefile Project" to the solution (Found under C++ projects).
2. Right click the project in solution explorer and select properties. Change the configuration type to utility.
3. On the visual studio toolbar click project and then select "Project Dependencies"
4. Select the projects that the item depends upon.
5. (Optional) In the project add batch files to run your tasks to the source files folder
6. Right click the project and goto properties
7. Under build events set the command line (or optional batch files created in option 5) task to run for the pre and post build events.

The crappy thing with this is that the prebuild will run after you are done.