There are several parts to this letter.
First and for most, is that it needs to be brief. It should not be more than one page at the most, and it should be not any less than can be put on a greeting card.
First Part--The Greeting: Dear Mr. and Mrs. First and Last name, The Class of _______ and I would like to take this time to extend our heart felt sympathies and offer our condolences for the loss of your [daughter or son], First Name.
Paragraph TWO--Virtues & feelings: FIRST NAME, was well liked in the school.
[Then write a couple of sentences bout things he did that was well liked.
End the paragraph with something like, We will always remember how.......[finish the sentence]
We will always remember [First Name] and the fun we had. We are extending a hand to you. If you should need any assistance or would like to talk, simply contact [give a name and phone number].
Warmest Regards XXXXX XXXXX
[Sign The Class of], then your name.
If you want to include the signatures of the class, it would be a nice gesture to include a picture of him having fun at school, mounted on a frame, with all the students signature....and something nice, for example:::: Jim, we love you and miss you. If the class is too large, a few signatures on the picture face (2 or three), then a scroll of the names of the rest of the class is attached.
The parents will likely keep this as a symbol of their son's life away from home.