Mercenary portals work much like normal ones — send your Imps in to claim them. The difference is what comes out: the rooms you build in your dungeon determine which creature is attracted, and a mercenary portal draws the heroic counterpart of the creature a normal portal would spawn.
Some examples:
Normal Portal + 5x5 Hatchery + Workshop = Bile Demon
Mercenary Portal + 5x5 Hatchery + Workshop = Giant
Normal Portal + (minimum) 3x3 Library = Warlock
Mercenary Portal + (minimum) 3x3 Library = Wizard