If the definition (not the declaration) of class B appears before the declaration of class A, then your case#1 should compile fine.
As Oxley pointed out, the reason for that is that C++ needs to know how much memory is needed for the B object, and it cannot do that without the definition of B.
However, if you use a pointer, (as in case#2), the amount of memory needed is known, because all pointers occupy the same amount of memory (32bit, or 64bit, depending on the system).
So, for case#2, all you need is the declaration of B before the definition of A. (note: declaration, not definition! of course, having the definition also won't hurt, but it's not necessarily needed).
Just to make sure I don't confuse anyone, (hey, maybe I don't have the C++ terminology down)
declaration: declares the existance of a class or a function, but doesn't say a thing about what it is.
e.g.
class A; //forward declaration
class C
{
A * a;
// .....
};
definition: actually defines the class or function. Although for a class, it doesn't necessarily define it fully, but it defines all of its members.
class A
{
int a;
int b;
void some_method(); //not defined here, only declared, but it's ok
};