I keep around a console project that I put my test code in. I just have to remember to put code I want to keep in a new project. Otherwise, I erase all the contents every time I want to test something else.

I'm sure you can create templates for VS as well, if you want to have a skeleton project (e.g. for setting up an OpenGL Window or something like that)