I doubt it punctured your skin through the shoe to do any damage, but i think going to Urgent Care or your PCP can't hurt if you're concerned.
Yes go straight to your doctor and ask for a test it may be nothing but always see a doctor wether the hospital or your surgery as its best to be safe than sorry they may stick you on some tablets as a precaution but don't worry too much about it you will get some answers from the doctors
It would be meaningless to go to the ER or urgent care unless there is an infection. You will go to the absolute end of the triage list, wait seventeen hours and get a $2,000 bill. The liklihood of an HIV infection is very small - perhaps infinitesimal - and in any event it takes six weeks to seroconvert, so getting a test before that time is not helpful. "Going straight to your doctor" will not be helpful. As as "sticking you on some tablets as a precaution" those tablets are toxic and have their own side effects. In addition oral medications do not travel well to the extremities. The chances are this was a diabetic needle. Many diabetics use three or four of them a day, and it probably fell from a pocket. Do check for redness and infection. If there is redness then you will need a physician's consult.
Caregiver said it all. I thoroughly agree, keep an eye out for redness and swelling and if noticed see your GP.
Last question... is there a difference between the way a diabetic needle looks compared to an illegal drug needle?