It may not be the most elegant solution but the following worked in my simple test -
Imports System.Runtime.InteropServices
<ComVisible(False)>
Public MustInherit Class TestGeneric(Of T)
Private _Value As T
Public Sub DoSomething(Value As T)
_Value = Value
End Sub
Public Function GetValue() As T
Return _Value
End Function
End Class
<InterfaceType(ComInterfaceType.InterfaceIsDual)>
Public Interface ITestString
Sub DoSomething(s As String)
Function GetValue() As String
End Interface
<InterfaceType(ComInterfaceType.InterfaceIsDual)>
Public Interface ITestInteger
Sub DoSomething(i As Integer)
Function GetValue() As Integer
End Interface
<ClassInterface(ClassInterfaceType.None)>
Public Class TestString
Inherits TestGeneric(Of String)
Implements ITestString
Private Sub ITestString_DoSomething(s As String) Implements ITestString.DoSomething
MyBase.DoSomething(s)
End Sub
Private Function ITestString_GetValue() As String Implements ITestString.GetValue
Return MyBase.GetValue()
End Function
End Class
<ClassInterface(ClassInterfaceType.None)>
Public Class TestInteger
Inherits TestGeneric(Of Integer)
Implements ITestInteger
Private Sub ITestInteger_DoSomething(i As Integer) Implements ITestInteger.DoSomething
MyBase.DoSomething(i)
End Sub
Private Function ITestInteger_GetValue() As Integer Implements ITestInteger.GetValue
Return MyBase.GetValue()
End Function
End Class