I could write out how to do this, but I couldn’t do better than this post here.
http://www.musicalgeometry.com/?p=1237
And in case you need to know how to create your Ad Hoc Distribution Provisioning Profile, look at the Apple notes here
http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/DevPortalGuide/CreatingandDownloadingaDistributionProvisioningProfile/CreatingandDownloadingaDistributionProvisioningProfile.html
And if you want to know how to add devices for testing. Get the UDID from the iphone or ipad, and in the the IOS Provisioning Portal go to “devices”. Select “add devices” in the top right corner. Enter the device name and device ID and hit “submit”.