You should use a syntax like: #include "myheader.h"
in your main.cpp (or where you want to insert the cpp file)
Where myheader.h is a header file and inside it you have the declaration of the functions/classes you want in your cpp file.
In the cpp you should insert the definition of your functions/classes (there are exception to this rule but I think that's the general idea).
I think that you can also define and declare a function/class inside a header file with no problem.
THe existence of a cpp is implicit (if you work on a project you should include it in it, if you complie it yourself you should compile it along with main.cpp etc)