We use
http://www.maxmind.com/app/geoip_country the free country version from here. City and state was a paid service that we didn't see the need for at the moment, but they have it available for you if you truly need it here:
http://www.maxmind.com/app/city. Price was $20/50,000 queries, or you can buy the data for $370 plus $90/month for updates. The $20 for 50,000 seems better to me, especially if you cache the data and only query new IP's.
They have a php module available here:
http://www.maxmind.com/app/php for the country piece. The data is updated for free monthly.
We're currently using the country code to weed out orders from the countries we don't accept orders from. Seems to catch almost all of them.
Brian.