I've never done it as the gold to cdkey / gamecard usually turns out a little more expensive than selling the gold to get a cdkey/GC.
Might be worth asking around how much, and getting a better deal, or asking one seller to beat another sellers price. Most of the companies are competitive (yes even the Chinese ones).
If all else fails, sell the gold for cash. The highest payer is MMOInn. But they seem to have gone downhill in terms of paying out to paypal, takes a while even after the cash is in your MMOInn account.