Treating a wound at home until emergency personnel arrive:
- Lay flat on the ground, although head can be elevated for comfort.
- Leave object in wound: This is because the object acts as a plug and slows the flow of blood from the wound, also, emergency staff are trained to take the objects out without causing more damage to internal organs and muscles.
- Apply pressure and dress the wounds as best as you can around the object, trying not to move it too much. If the object isn't there, use a shirt or clean fabric to apply pressure on the wound. You can also place a credit card in the wound to try to stem blood flow. If it is really bleeding badly apply pressure to the artery (pressure points) leading to the wound. In limbs this is done by tying a string of cloth around the top of the limb close to the torso. Just make sure that fingers and toes are not turning blue or black from lack of blood flow.
(I learned this in first aid class, but here is the wiki that explains it: Attend a stab wound)
There is actually a new object that the FDA just approved to help aid in the treatment of wounds like this. It's called the XSTAT. It's been used on the battlefield already to slow blood flow in the wound(s). Basically it stuffs the wound to prevent further blood loss.
When you're in the hospital, the object will be surgically removed. It is like any other surgery like heart valve replacements or an appendectomy. These surgeons also have to be trained for accidentally nicking an artery. You can either sew the wound together or use heat to seal the wound. It's basically like any other surgery, only they have to use things like Ultrasound and Xrays to make sure that they've closed all of the bleeds. If you want more information, you can read here about a test case "Ricky" who was shot.