As a DM, I do it exactly the way StreamOftheSky described it. Great minds think alike ...
The basic premise is that it shouldn't be *more* difficult for you to voluntarily hand an item to an ally than it is to involuntarily hand an item to an enemy. That is, an ally should be able to disarm you as easily as an enemy can.
So, as a free action on your turn, you can voluntarily provoke an attack of opportunity from an ally. Then the ally, on his turn, can move to within "disarm" reach and take an attack of opportunity against you (presumably, attempting to disarm you of the item), and you can voluntarily allow yourself to be disarmed.
Under these rules, the giver must declare in advance, on his turn, that he intends to let down his guard, and the taker must then spend the AOO. A theoretical downside is treachery: the giver is letting down his guard against the taker, so the taker could in theory do something treacherous with that AOO rather than cooperative.
If the giver hasn't declared in advance, the taker must either take the item by force (a real disarm attempt) or take some sort of delaying or readying action so that he acts after the giver has declared.