Nice and easy:
get-qadcomputer -OperatingSystem "*XP*" -IncludeAllProperties | Where-Object { $_.lastlogon -lt (get-date).AddDays(-30) }
Do bear in mind that lastLogon is not replicated and may not give you a true picture if you have more than one Domain Controller.
HTH
Chris