There are a number of possible routes. The one involving the fewest changes of train takes a bit over 57 hours (Madrid Chamartin depart 7pm; Moscow Belorusskaja arrive 6:25am) with changes in Paris (transfer between stations), Frankfurt and Vienna.
See http://www.bahn.de/international/view/en/index.shtml