' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices

<assembly: AssemblyKeyFile("Delphi.snk")> 
Namespace Delphi
    <Guid("4A855566-3146-40dc-A226-45570F86FD0B"),InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> Public Interface ITest
        <DispId(1)> Function Dup(s As String, n As Integer) As String
    End Interface
    <Guid("F87E97F4-8B5F-4761-BBE4-13512B9BA03B"),ClassInterface(ClassInterfaceType.None),ProgId("Delphi.Test")> Public Class Test
    Implements ITest
        Public Function Dup(s As String, n As Integer) As String Implements ITest.Dup
            Dim res As String = ""
            Dim i As Integer
            For i = 1 To n
                res = res & s
            Next
            Dup = res
        End Function
    End Class 
End Namespace
