The mecca for this kind of shopping is Zhongguancun. Near Beijing's universities in Haidian District, it's a 45-minute taxi ride on a really, really good day from the CBD, although it's closer to the Olympic Park in northern Beijing. The area became the capital's technology hub first by employing and serving college students; now some of those college students have companies listed on overseas stock exchanges, and work from buildings in their old neighborhood named after their companies.
You can cut some time off the ride by taking the subway. The Zhi Chun Lu station on Line 13 puts you close by. For a full look at the area's technological goodness, see this guide by IDG News Service's Sumner Lemon.
Closer to the CBD is Bai Nao Hui, a technology market, about 400 meters east of the Chaoyangmen intersection and subway station. Although less extensive than Zhongguancun's markets, the selection is still solid for portable hard drives, accessories like headsets, blank DVDs and CDs, and mobile phones. Most vendors speak enough English to bargain, and if push comes to shove, use the calculators they provide to display your offer price. Depending on the item, you should be able to get a 20 percent discount, sometimes more.
So, good luck and have fun!