What you do is that you define your dynamic class as a member of an outer class. Then you create an instance of the outer class, and index out the inner class. This will give you an svalue which acts like a regular "program" type value, but which includes a reference to the outer object which will carry on to any objects created from this value.
So basically you'll need to create two classes for each dynamic class, one outer class which contains the common storage (the actual storage definition can be inherited from a base class), and inside that class your "real" class.