The add() method on MSelectionList combined with MGlobal::setActiveSelectionList() provides one method for a plug-in to modify the active selection list.
Another way is to use MGlobal::selectByName(). This finds all objects matching a pattern and adds them to the active selection list. For example:
MGlobal::selectByName( "*Sphere*" );
selects everything with Sphere in the name.