Introduce yourself (briefly), ask for more details of the project, perhaps ask for recommendations for background reading. Other things you might enquire about include the level of support for conferences, opportunities to teach/help supervise students, and the likelihood of follow-on funding (if the advertised position is relatively short). Note that you don't have to ask everything in your first email, and save yourself some questions in case you get called for interview. Attaching a brief CV can't hurt - but don't make me open an attachment to find out where you've studied and who you're currently working with.
Also, remember: writing this email seems important from your perspective. However, the PI probably gets dozens of emails daily, and will barely notice the precise words you use. Don't get too hung up on the content of your message!
I would always direct my letter towards the PI, even if it is to be sent to an HR contact for initial processing.