You can find an example of implementation of the callback function in the "VisualBasic" sample folder. Actually the implementation is simpler than you expect, as you 'just' need to pass a VB class reference and class function name as callback arguments as below, where "Callback" is my user-defined class (syntax of the prototype is closer to C++ but that's Automation)
Dim callbackObj As New Callback
Private Sub CheckEndCallback_Click()
' If checked
If CheckEndCallback.Value = 1 Then
' Set a callback function to be called upon FastCap2 end of simulation
vResult = FastCap2.SetEndCallback(callbackObj, "FastCapEndCallback")
' Set no callback
vResult = FastCap2.SetEndCallback(Nothing, "FastCapEndCallback")
This is not straigthforward, instead, in case you need to implement it in VBA (VisualBasic for Applications) or VBS (VisualBasic Scripting) as there are limits in what you can do in these VB profiles.
You may have some luck and insight looking at ht*p://alax.info/blog/1381 I have not tested these methods, but this could be a way you may experiment.