As Crafty mentioned above, the preferred method for adding code to a project is through the Editor, by clicking on File → Add Code to Project… This will give you a wizard where you can select what existing class your new class will be derived from, and will automatically create both a .h and .cpp file for you with a basic framework already included in them to get you started creating a new class for UE4.
If you choose to create new files from within Visual Studio, you will need to do what staticvoidlol mentioned and move those files from the default location where VS creates them (using the file path in the error message you quoted it would be \MyProject\Intermediate\ProjectFiles) into your project module folder (\MyProject\Source\MyProject). If you do it this way, you will also have to regenerate your solution in order for the files to be recognized as part of your project and build successfully.
One option I prefer is to specify where Visual Studio will place the newly created file. When you right-click on your project and choose Add New Item, right below where you enter the name of your new file, you will see the location where it will be created. You can change this to show your project module folder, and then the file will be placed in the correct location for you when it is created. You may still have to regenerate the solution for the file to be recognized by the Engine. Note: This option does not appear to be available if you create a new class using the Visual Studio class wizard (in which case you would be better served by adding your new class through the Editor).