The best thing to do is to just book Milan - Domodossola with Trenitalia. North of Domodossola your Swiss Travel Pass is valid. Doing it like this will probably be the cheapest option.
First look up which trains you want to take, so you can book your desired departure on Trenitalia.