On top of all the recommendations here I'd have to recommend going to Nippori (it has two stations on the Yamanote). My guidebook (LP) had a great walk which takes you from one station to the other passing temples, shrines and the like, there's also a massive graveyard inhabited by an army of cats and a few ravens, it's quiet and cool as hell usually.
I went in Summer last year for Comiket. Stayed a week in Gotanda (handy for the train to the Big Sight) and it was one of the best holidays I've ever had, there's tons to do and I wished I'd stayed the extra week to see everything. As people have said Suica or PASMO passes are convenient and fun to use (I loved being able to just tap my wallet on the machines without even opening it) see if you can get a good food guide as Tokyo has some of the best eating places around. Akiba is somewhat disappointing since they de-pedestrianised it, but it's still great fun (harsh on your wallet though).
Also, one your way back, I'd personally recommend getting the train to Narita from Nippori. At Ueno, the platforms for the NEX and Skyliner are in a different station building that's 100 or so yards down the street, a pain if your carrying heavy luggage (like I was) and makes it weasy to miss the train. At Nippori, the two sections are connected by a bridge and are in the same building so it's much easier to transfer between trains. Also, on your way back don't be an eijit (like I nearly was) and REMEMBER how long it takes for the trains to reach Narita, Skyliner takes around 50 minutes and the Limited Express an Hour and a bit. Though they may have introduced other services since that are faster, (someone correct me if this is the case please). I nearly missed my flight because I slept in and underestimated how long it would take to get to the airport. Even though it's a Tokyo airport, it's really far away from Tokyo city centre (further than Heathrow in London or JFK in New York for example) so be aware!
You'll love it though.