Application.Caller from a COM Addin
In VBA, you can use Application.Caller.Rows.Count to find out the expected size of an array forula, so you can return an array of the right size.
In c# you can also do this!
Check out the page Writing an Excel COM AddIn first so you can get hold of the Application object.
Then: