Writing a letter of recommendation is serious business and has changed a bit over the years. These days, because of lawsuits about misrepresentation, recommendation letters are typically short and sweet and stick to the facts. The main thing that a recommendation letter should accomplish is informing the potential employer or admissions board of the relevant skills, experience and abilities of the applicant. It also is a means to officially verify employment or vouch for an applicant's character.
Specific formatting, like where to put the company address or salutation, are not important unless specified by the applicant. What matters is that the format is professional and well-organized. The standard introduction, body and conclusion format is still preferred by most employers and learning institutions. So after a salutation, either personal or of the "Dear Sir or Madam" variety, you should introduce yourself and briefly describe your position and relation to the applicant. You also should include the length of time you've known the applicant and anything else that might establish your credibility. This should be a short paragraph, typically four to five sentences.
The body of the letter should detail the applicant's qualifications and experience. Again, because it's your own name on the line, just include information that is absolutely true and verifiable. Try to use specific examples of why you feel like the applicant deserves consideration. If you're listing several reasons, start with the most relevant or important. You also don't want to go overboard. The goal is that the letter is read in full and not skimmed over because it's too long. Keep the body to a couple of short paragraphs.
The conclusion should include an ultimate confirmation that you feel like the candidate meets the standards of the institution, job or program he or she is applying for. If you feel like you can add a nice summarizing statement, this is the place to do it. You should also encourage the prospective employer or school to get in touch with you personally if there's anything else they need, and include your contact information. Close with a friendly "sincerely" or "best regards" and make sure you personally sign the letter.
If you've written an effective recommendation letter, the applicant should come across as an experienced, competent and credible candidate for the position he or she is seeking.