You take a local (Regionale) train from Como or Varenna to Milan Central, and change there for a fast long-distance train to Venice.
For the Milan-Venice train, the cost depends on how far ahead you book. For the best prices, book direct with the train operator as far ahead as possible. Tickets usually go on sale 4 months before travel, and the cheapest tickets often sell out quickly. The discounted prices keep going up as the travel date gets closer.
You can get train times and costs from www.trenitalia.com using the Italian versions of city names. At present, times are not posted beyond 8 June. Just keep checking the site.