I don’t have an Apple TV or iPhone but I discovered that I could do this from my iPod Touch to control iTunes on my G4 Mac mini (which is connected via HDMI to my HD TV). I use it to watch TV shows ( Avatar: The Last Airbender ) from my couch.

Any time you need to type on Apple TV, if you have the Remote app open on your iPhone, the keyboard will appear and you can just type on your iPhone instead.

(Via -Daring Fireball: Distant and Remote.)