See the question and my original answer on StackOverflow

The IDispatch::Invoke() method must be called with parameters in reverse order, as stated in the official documentation:

Implementing IDispatch / Passing Parameters:

The arguments are passed in the array rgvarg[ ], with the number of arguments passed in cArgs. The arguments in the array should be placed from last to first, so rgvarg[0] has the last argument and rgvarg[cArgs -1] has the first argument.

Also, in your case, you don't need "named arguments", only "positional arguments". If cNamedArgs is 0, all of the elements of rgvarg[ ] represent positional arguments.