How to create a class in visual studio 2012?

First you have to create a project, that will generae a default *.cpp file. You can put your class there or add a *.h file to the project. You might want to read Getting Started page here.