In setting up pop3 or IMAP on your Desktop email client, one of the most important things to realize is that that you use username@mydomain.com for the 'User Name' located in the Login Information section of the pop3/IMAP setup box. Don't use username@gmail.com when configuring pop3 or IMAP for one of your mydomain.com accounts. Secondly use the standard gmail servers. Don't use smtp.mydomain.com as the server. The following Help pages will work as long as you use the correct User Name. Help pages:
pop3:
http://mail.google.com/support/bin/answer.py?hl=en&ctx=mail&answer=12103
IMAP:
http://mail.google.com/support/bin/answer.py?hl=en&ctx=mail&answer=75726
IMAP/POP Troubleshooting help page:
http://www.google.com/support/a/bin/answer.py?hl=en&answer=33384
Gmail POP Troubleshooting Tool:
http://mail.google.com/support/bin/answer.py?answer=75293#RunPOPTS
http://dl.google.com/gmailpoptroubleshooter/GmailPopTroubleshooterInstaller.exe