Using the code at https://xll8.codeplex.com for new projects. In particular https://xllfunction.codeplex.com. It uses XLL.BIND and XLL.CALL to make functions first class objects in Excel. If you’ve wondered about monads, these are some practical examples, for some value of practical.