To make it a formal letter, it should include the writers full name, address, phone number and signature. The CIC will never contact the writer of a letter, but putting in all this info makes it look more legitimate and official since most letters are not notarized/certified.
The basic info needed is the writer's relationship to either sponsor or applicant, length of time writer has know them, how they met the spouse/partner, what they think of the relationship, confirm if spouse/partner are living together etc etc. Each letter can include personal stories and anecdotes, and since this is personal for the writer, each one will be different. As long as it gives testimony the relationship is real, that is what counts.