An invitation letter is not necessary. You may write your friends or relatives a formal letter including name and relationship of the visitor, the length of visit, who will financially support their visit and the purpose of their trip. If they are planning to attend the graduation ceremony you can send them a copy of your graduation information, a graduation announcement, a copy of a letter certifying your impending graduation, or a copy of your registration statement to prove that you are currently enrolled in classes. If you are supporting your visitors financially you might want to provide financial documents.
To find out what the specific Embassy/Consulate requires check their website at http://www.usembassy.gov. Please note that there might be restrictions on what you are allowed to bring with you to the Consulate or Embassy.