It is a US territory but since it's a port of entry you have to do customs. You will go through Customs and Immigration upon your return to the mainland from the USVI, not upon your arrival to the USVI from the mainland. You will also go through immigration if you make a trip to the BVI. Hope that helps!