SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
I have just had the 'unable to cast' error and the fix can be found here.
Tl;dr, you need to use an activator:
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000043p000000