mayabo's original code (other than the line cout << (A)DUDE; ) should actually work. The line name="bob"; in B's constructor is not required (and A::name can be made private).
The compiler is able to do the conversion "derived class to public base" (i.e. B to A) implicitly.
If you're getting errors, then either there is some code in play not being shown or you have a buggy compiler (really old versions of VC++ come to mind).
It would probably be better to make getName() a const method (optionally virtual) and for the operator<<() to have its second argument a const reference.
And "using namespace std;" before a class definition: wash your mouth out with soap, particularly if you do that in a header file.....