Purchasing a ticket is fairly simple. Just go to any trekking company in Thamel, Patan, Bhaktapur, Pokhara and ask for a quote. It's important to understand that if they are not a direct representative of the bus line they will put a commission on top of what the normal charge is. That's the bad news, that you will need to shop to get the proper price. However, the good news is the one-way ticket to anywhere in Nepal or to northern India will cost less than $20. You can ask your guesthouse manager for a ticketing office.
The bus to Varanasi leaves from Swayambhunath or 'Monkey Temple.' twice a day, once in the morning and once in the evening and conversely, arriving from India. The buses are usually quite comfortable and they stop at places with tourist-appropriate standards. Some buses are air-conditioned and some even have WIFI.
For information on how to get from Varanasi to Kathmandu please check out this post: About the new bus line to India I strongly suggest reading the warnings in that article.
FrugalTravels' best advice: I would not attempt a bus ride all the way through. I would suggest leaving Kathmandu a bit earlier and spending a night or two in Chitwan or Lumbini. Particularly if the bus is not air-conditioned, you will not have a pleasent time trying to get there in one 24 hour nightmare. Even if the bus has 'air-conditioning' that doesn't mean it will work. This is the best way to see Chitwan during some parts of the year, anyway. Keep in mind that the weather plays a big part in how much time to spend in the lower elevation areas of Nepal. Here's a bit of information about Chitwan
Tip: If you want to have a better chance of less traffic, travel on Tuesday. The Nepali believe it's bad luck to travel on Tuesday or buy things on Tuesday.
Lastly, here's another post I wrote about Chitwan.