I just answered a very similar question on StackOverflow. Here it is for posterity:
Create a new file in Sublime with the following content:
"cmd": "mingw32-g++.exe", "-o", "$file_base_name", "$file"],
"cmd": "start", "cmd", "/k", "$file_base_name"],
On the 2nd line, change the name of mingw32-g++.exe to whatever g++ is on your system - possibly just g++.exe. Save the file in the User subdirectory of your Packages folder (which should be in %APPDATA%\Sublime Text 2) as new_g++.sublime-build. When you select this build system as your default (Tools -> Build System -> new_g++), hitting Ctrl-B will compile your program, and then hitting Ctrl-Shift-B will execute it. start is the command to start running a separate process, cmd is short for cmd.exe, the Windows command line program, and the /k option keeps the resulting window open after your program exits so you can see its output, run additional commands, or what have you.
The reason the build command failed is because it is trying to call bash, which is not installed by default on Windows systems. This bug has been fixed in Sublime Text 3.