You can't do this directly (if VS is doing your COM registration, you should see a warning like: Type library exporter warning processing 'NS.Obj.get_GetProp2(#1), Assy'. Warning: Type library exporter encountered a generic type instance in a signature. Generic code may not be exported to COM.
What you'd need to do is make a little non-generic wrapper and an interface to expose to COM (assuming you want strongly-typed objects). As long as you reference the typelib in VBA and access your objects through strongly-typed VBA refs, you can do something like:
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
public class Class1
{
public IMyListOfString Strings {get; set;}
public Class1()
{
Strings = new MyListOfString() { "Foo", "Bar", "Baz" };
}
}
[ComDefaultInterface(typeof(IMyListOfString))]
public class MyListOfString : List<string>, IMyListOfString { }
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface IMyListOfString
{
[DispId(0)]
string this[int idx] { get; set; }
}
There's a trick to getting this to work without referencing the managed typelib in VBA (eg, latebound), too, but I've been out of the COM interop world too long to remember what it is.