You store the class and rule definitions in a database (flat file or relation database such as Oracle), and tell the system to load the new information and behaviors. I have a patent for adaptive systems that allows you to declaratively define new classes, or extensions to these or existing compiled C++ classes, and determine their behavior with a set of rules, without compiling any of the new classes or behaviors, yet these can be integrated with existing compiled C++ programs without compiling.
FWIW, in the 1990's up to about 2005, I used C++ exclusively for similar work, though you have to do a LOT of preliminary class development in order to get the same efficiencies as Prolog provides 'out-of-the-box'.