Custom Commands are, in my experience, bundled in a Driver Command. The system will call a member function, eg Execute() or BeginExecute(), when the driver command needs to be executed. Look at the code for some of my driver commands, or those of many others.
If you are trying to execute outside of a driver command, I suggest you examine the member functions to be overridded for a customcommand.