From combinatorics to large deviations for the invariant measures of some multiclass particle systems