Hi Chris!
I always love to read your posts about the English language. It makes us all think a little bit!
As with the word Herr, the word sir is used to show a little more than the normal amount of deference or respect. When you use the word, you're showing the other person that you're being respectful, and that you're making a little more effort to not offend. Since the word is not commonly used in daily conversation, the fact that you use it shows that you're trying to say something in the best way.
And, it's perfectly acceptable to use the word both in a formal, official situation, and also in a friendly, humorous way.
For example: When you're being given a speeding ticket by a police officer.: "Yes, sir. No, sir. I promise, I'll be more careful in the future, sir."
And, when you're having a fun beer argument with a friend about a favorite sports team, and he's laughing at your favorite player: "You, sir, are about to cross a line!!"
I'll add one more point on the use of the word sir: Normally, it's used in place of the name of the person you're talking to, not along with the name.
For example: "Thank you sir, for your support." would be preferred over "Thank you, Rich, sir, for your support." And old_tv_nut is correct, commas are necessary.
The female equivalent is indeed "madam". When it's written it's spelled "madam", and when it's spoken it is more commonly pronounced "ma'am", which is the abbreviation. It would be pronounced "madam" when followed by a woman's name or title, but "ma'am" when spoken without a name. For example, when talking to a female Secretary of State, she would be referred to as "Madam Secretary", and if she asked you a question, a perfectly acceptable way to answer would be "Yes, ma'am.", instead of the full "Yes, Madam Secretary."
The word "ma'am" is pronounced as a single syllable, without a pause for the apostrophe or the extra syllable: "mam".
Should you ever find yourself answering questions in front of a judge in a court of law, these words are fully acceptable in place of the customary "Your Honor". "Yes, sir. No, sir." "Yes, ma'am. I understand, ma'am."
Capitalization: Basically, the word is not usually capitalized unless it's the first word starting a sentence, or the opening greeting of a letter or email, or it's part of a title: "Sir Clay".
http://grammarpartyblog.com/2013/02/18/when-to-capitalize-sir-and-madam/