Suppose you are paying $6,000 this year for in-state tuition, fees, and books at a public college (paying out-of-state rates would add another $6,000 to that, and attending a private college would add about $15,000). The opportunity cost of paying for tuition, fees, and books is what you and your family could otherwise have purchased with that money.
How about room and board? Expenses for room and board are not necessarily an opportunity cost because, even if you were not attending college, you would still need to live somewhere and eat something, though these could cost more in college. Likewise, whether or not you attended college, you would still buy goods such as CDs, clothes, and toiletries, and services such as laundry, haircuts, and DVD rentals. Your spending for such products is not an opportunity cost of attending college but the personal cost that arises regardless of what you do. So for simplicity, assume that room, board, and personal expenses are the same whether or not you attend college. The forgone earnings of $10,000 plus the $6,000 for tuition, fees, and books yield an opportunity cost of $16,000 this year for a student paying in-state rates at a public college. Opportunity cost jumps to about $22,000 for students paying out-of-state rates and to about $31,000 for those at private colleges. Scholarships, but not loans, would reduce your opportunity cost (why not loans?).
This analysis assumes that other things remain constant. But if in your view, attending college is more of a pain than you expected your next best alternative to be, then the opportunity cost of attending college is even higher. In other words, if you are one of those people who find college difficult, often boring, and in most ways more unpleasant than a full-time job, then the cost in money terms understates your opportunity cost.