The use of sir to address someone is pretty archaic in Britain now. It might be used in letter writing, where it would usually appear in the form "Dear Sir/Madam", where the identity of the recipient is unknown. It may be used by staff in shops and restaurants, but again this would be quite formal (and mostly employed when politely refusing to do something the customer wants).
Knights of the realm, those knighted by the Queen, have their names prefixed by Sir thus, "Sir Terry" for Terry Pratchett, for example. (Someone with more leet etiquette skills than me will need to confirm whether Bill Gates can be addressed as "Sir William". I expect not, as the knighthood in his case is honorary - a genuine knighthood can only be bestowed on British subjects.)
The corresponding archaic/formal terms of address would be
Sir - for an adult man
Madam - for a married woman or older woman (1)
Miss - for a girl or unmarried or young woman
Master - for a boy
Note that using these forms of address outside of the contexts listed above will get you funny looks. They aren't really used except in those specific contexts. In particular "Master" would only ever appear on very formal correspondence, such as if the Queen was inviting a young boy to a garden party, and would be unlikely to appear on its own ("Master Robert"). You'd probably have to go back to the early to mid 20th Century for them to be in common use.
(1) 30 seems to be about the time I started to get referred to as "Madam" rather than "Miss", although often people simply stop using these forms of address, as some women can be a bit touchy about the "wrong" one being used.