Traveling Cuba using Viazul buses is the best way in terms of price, comfort and safety. Unfortunately Cayo Coco is accessible by plane or taxi, and not by using Viazul buses.
You can use a taxi from Trinidad to Cayo Coco. Or you can use the Viazul from Trinidad to Ciego de Avila, and then use a taxi from Ciego de Avila to Cayo Coco.
This second option is cheaper, and on your way back you can use a taxi from Cayo Coco to Ciego de Avila, then use the Viazul bus to Santiago de Cuba or wherever else.
As soon as you arrive to the Viazul station in Ciego de Avila, you'll find lots of private taxis which can take you to Cayo Coco. Private taxis are cheaper than government taxis.
You can check Viazul prices in their website. The price of a private taxi varies, but to have an idea, a private taxi I used from this accommodation service from Varadero to Cayo Coco is about $240.
If you're staying in a rent house in Trinidad, your rent house owner can advice on taxi prices to Cayo Coco directly or from Ciego de Avila.
Hope it helps.