Use devcpp, it's rather old now but for your first c++ programs it's a very easy to use IDE
if you insist on using microsoft visual studio, make an empty w32 console project and add a cpp file. Using this method you can directly copy the examples of your book in the cpp file & compile them.