Use dynamic_cast<>() as a function, which helps you to cast down through an inheritance hierarchy (main description).
If you must do some non-polymorphic work on some derived classes B and C, but received the base class A, then write like this:
class A { public: virtual ~A(){} };
class B...