Well that's a different story to just using it from your 'main' function.
There are 2 different types of forward declarations for classes.
Just putting "class myclass;" lets the compiler know that the class exists but doesnt say anything about its methods etc. This is usually used to resolve cyclic dependancy problems.
The other type is "class myclass { /* class member declarations here */ };" This lets the compiler know all the members of the class but doesn't have to define the body of each function. These normally go in header files.
Take a look in the irrlicht source to see how to mix these together. eg in IAnimatedMeshSceneNode.h, IAnimatedMeshSceneNode is forward declared so that IAnimationEndCallBack can use it. IAnimationEndCallBack can't call any of IAnimatedMeshSceneNode's methods because they haven't been declared yet. This doesn't matter because this is only the declaration of IAnimationEndCallBack and doesn't contain any executable code. (This isn't a great example because all the methods are virtual and therefore never contain any code).
If this doesn't help, I give up. I suggest you read some C++ books/tutorials. (Or switch to C#
)