When my mother was visiting a couple years ago, she fell and separated her shoulder. We took her to the hospital and though she was ready and willing to pay for it, she never got charged! I guess they counted it as emergency treatment even though it wasn't dire or anything. We love the NHS!
If it's considered emergency treatment in A&E, then it will be free (I think sometimes a GP visit may be free too). However, as soon as it stops being classed as an emergency, you have to start paying... for example, if you are given a prescription, moved to a ward, or treated again later as an out-patient for the same problem.
They won't necessarily give you a bill automatically, because they aren't used to having to charge for treatment and some staff may never have even issued a bill to anyone before, so it's something you have to push for and insist that they do, if you believe you should be paying for it.
So, it's up to you to find out the rules for visitors, to know whether you should have paid or not, and if they say it's free when actually you think you should have been charged, you need to insist that they bill you for the treatment.
Alternatively they refuse to bill you, get them to write a letter stating that you tried to pay, but that they have decided that you do not need to be charged - that way you have proof for immigration if it ever comes up/if you apply for a visa in future (because if you have more than £1,000 in unpaid NHS debt, it's an automatic visa refusal).