VM's are a great place to setup your development environment. I'd recommend a couple things though, aside from what's already been mentioned.
First, once you have Windows/Linux/whatever freshly installed and updated, copy it. It's good to have a clean install available to test your code in, especially when you have program dependencies and you need to be able to tell someone else how to run your code/program who doesn't have your same development environment. I've had programs that use all kinds of dependencies on other programs and libraries (Boost/Python/Pcap/etc.) and you want to make sure your code will still run without all that installed.
Second, once you get your entire build environment setup, take a snapshot. I can't tell you how many times I've set up the environment just to install/change something later and have the whole thing blow up on me. As you install more stuff, keep making snapshots. As long as you have room on your computer, I'd use as many snapshots as you can.
Third, depending on your host platform and what you're developing, you will take a performance hit in a VM. Running a Windows VM on a Mac platform requires binary translations, so things will go just a little slower. Doing a large amount of I/O (or other instructions) that causes VM_EXITs will also cause performance hits. However, for development, you shouldn't have too much of an issue. In my experience, compilations tend to take 10-15% longer in a VM, depending of course on what development tool you're using. Some will be better, some will be worse.
Overall though, VM's are an extremely handy way to create development environments and to test your programs in a user type environment. So I'd highly recommend them.