Here is a snippet of code that I am using in a C++ DLL module of mine:
TS::SequenceContextPtr pSeqContext_;
TS::SequenceFile *seqFile_;
TS::Thread *threadObj;
_bstr_t seqName_;
bool threadStatus;
...
At this point in the code all the variables defined above are initialized
...
threadObj = pSeqContext_->Execution->NewThread(seqFile_, seqName_, 1, NULL, NULL);
threadStatus = threadObj->WaitForEnd(-1,true,
(IDispatch *)pSeqContext_->Step->AsPropertyObject(), (IDispatch *)pSeqContext_->AsPropertyObject());
...