There is an active thread on this topic in the UA/MP forum - try:
www.flyertalk.com/forum/showthread.php?t=456238
In short, you won't have time to actually go into Tokyo, which is a 1 to 1 1/4 hour train ride one way. Coupled with the long C&I lines arriving and departing, you just wouldn't make it.
Three hours may not even be enough time to run into Narita City, but if you get lucky with a quick trip through Immigration, it might be worth a try. The train into Narita City runs every 20 minutes and takes less than 10 minutes. There are ATMs at the airport to buy a few yen and there is a very nice temple complex and shopping district near the train station in town.
Frankly, I'm not sure I'd recommend leaving the airport with only 3 hours, but it could be done. You might want to check out the Narita Layover page at
http://www.mgnewman.com/narita/ .
JR