I have a Dictionary to map a certain type to a certain generic object for that type. For example:
typeof(LoginMessage) maps to MessageProcessor
The following seems to work as well, and it's a little bit shorter than the other answers:
T result = (T)Convert.ChangeType(otherTypeObject, typeof(T));