When I import a module that has a class, what code is executed when that class is first read and the class object created? Is there any way I can influence what happens?

Edit: I realize my question might be a bit too general...
I'm looking for something more low-level which will allow me to do introspection from C++. I extend my C++ application with Python. I have some classes that are defined in C++ and exposed in Python. The user can inherit from these classes in the scripts and I want to be able to grab details about them when they are first defined.
Python is interpreted, so when a Python module is imported any class code at the module level is run, along with those classes' meta-classes -- this is so the classes will exist.
C++ is compiled:  the classes already exist when they are imported; there is no way to control how they are created as they are already created.
What code is executed when a class is being defined?