Instantiate class by variable?

I need to instantiate a class based on a variable, how can this be done?