Poor bun! I had that exact same thing happen to my first bun (and I think at some point in Foxwell's mysterious past as well, as he is missing a claw on one of his front feet). I have to imagine it really hurts, especially after having lost a few fingernails myself. If I were in your shoes, I probably wouldn't medicate unless it was prescribed by a vet for this specific case, just to play it safe, and, while painful, should heal alright without analgesics.
This is a case where I'm a little on the fence if you need to go to the vet. If the bleeding has stopped and you keep his area and foot clean to prevent infection, there isn't much a vet can do to improve the situation. If there is an infection, risk of, or you are struggle to keep the foot clean, a vet would be a very good idea.