I have a fuzzy idea of what you are intending to do. You might want to use generic VIs to handle different reference types but at some place or some other place in your program you will have to differentiate what type you are actually handling to cast it properly and use it.
Obviously, using flattened data, you can't typecast it to its datatype if you don't know the datatype in the first place... e.g. you can't typecast the reference flattened data to a specific type without statically wiring to a known reference type.
The best you can do is illustrated in the attached VI. The VI accepts a refnum in its variant input. The type of object refnum is detemined parsing the type string. The type is used to determine which method VI to use,
set the value of its reference input and run the method VI.
I hope that helps.
Jean-Pierre