What kind of action does this cost?
This uses an immediate action. When it says:
you can instead choose to let an ally make a melee basic attack against that target as a free action.
The free action is what your ally uses to perform the attack, not what you use to enact this effect. Enacting it still takes an immediate action.
This is just convention
All powers or effects which grant free actions to allies are worded this way. D&D 4e's authors love following convention in the core rulebooks, and this is just another instance of the same convention being used. A browse of the Shaman or Warlord power lists will turn up several occurrences of this same convention.
Consider, for instance, the Warlord's Hammer and Anvil power, an encounter power, which says:
One ally adjacent to the target makes a melee basic attack against it as a free action.
Or the Shaman's Ancient Warlord's Inspiration, a daily power, which says:
If an ally starts his or her turn adjacent to the spirit or in its space, as an immediate
reaction you can allow that ally to make a basic attack as a free action.
These powers still take a standard action to use. There'd be absolutely no point to saying you use a free action to grant the attack, since you're already granting it as one of the side-effects of your standard action-costing power.
When can you use this?
So the real question is: when can I make a melee basic attack, if the trigger is activated, or when I actually spend the action?
You can use this when you can spend the action.
The trigger is:
When you can make a melee basic attack against a target because of Combat Challenge
You can only make a melee basic attack because of Combat Challenge if you actually use Combat Challenge (which takes an immediate interrupt) to grant you a melee basic attack. Then, instead of performing that melee basic attack, you let someone else do it instead.
This effect just modifies Combat Challenge. It doesn't grant your allies free attacks constantly.