Using com-visible, as user1467261 suggested allowed visibility of the object. The object had to be accessed using CreateObject in the VBA. The code is below.
COM Library - Compiled to DLL, registered with regasm as tlb, added tlb to VBA project references
using System;
using System.Net;
using System.Runtime.InteropServices;
using System.Globalization;
namespace ClassLibrary1
{
[Guid("a81acfd7-ca29-4b71-b45d-d9ffd8930036")]
public interface ITest
{
string HelloWorld(string name);
}
[Guid("bb212288-fa1a-432a-9456-e1c3bb78923f"), ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
public class Test : ITest
{
public string HelloWorld(string name)
{
return "Hello World! I'm " + name;
}
}
}
VBA
Sub hwn()
Dim thing As Object
Dim text As String
Set thing = CreateObject("ClassLibrary1.Test")
text = thing.HelloWorld("Fred")
Debug.Print (text)
End Sub