You can use this snippet:
$module = JModuleHelper::getModule('custom', 'Custom Html');
$module->content;
Where the first parameter is the module name (for this question is always gonna be 'custom' ) and the second parameter is the module title ('Custom Html' in this example)
Api Docs

UPDATE
I've forgot to mention, the module requested must be published and set to appear in the current page.
If it's a module that I would access only programmatically, I would publish the module on all pages in a position no used by any template

