If you can get your horse to a vet, that would be my first recommendation. If you can talk to your vet by phone do so. Your horse may need shots, antibiotics etc. However, if you are unable to get your vet's help, here are a few tips that might help.
First, if your horse is still frightened or agitated from the ordeal you will want to calm him enough to get a better look at the injury, clean it, and treat it. Once he has settled down at least some, give him some Bute paste (if you have it), this will help reduce swelling and pain, as well as have some additional calming effect. You will need to cut away the hanging flesh with sterile / sharp scissors. Next you will want to "hydrate" the wound with cool clean water. Running a hose over the wound for about 15 minutes, twice per day, every day until the wound is well healed (this may take several weeks). The cool water will help to reduce swelling, and reduce pain, as well as clean the wound and stimulate blood flow. You will want a medium flow of water (Not so much that it is painful, but strong enough to remove any debris, grass, or dirt). If the water causes a little blood to flow, that is OK.
If the wound is high enough up his leg that he won't get a lot of dirt in it you may not want to bandage it. Especially because you will want to treat the wound often and may heal better when it gets air. My horse had a similar injury. My vet recommended leaving the bandage off and he did great. Finely, you will want to put a soothing- antibacterial salve on the wound. If "proud flesh" (a thick pink flesh) begins to develop on the wound you might want to switch off using the salve and try some "wound powder". Wound Powder is available at most farm supply stores.
If you do bandage the wound you should get your vets specific advise on the best bandaging technique to use. The bandaging technique used will, in part, depend on the location and severity of the wound.
Good luck and let us know how your horse is doing.