Let K〈X〉 denote the free associative algebra generated by a set X={x1,…,xn} over a field K of characteristic 0. Let Ip, for p≥2, denote the two-sided ideal in K〈X〉 generated by all commutators of the form [u1,…,up], where u1,…,up∈K〈X〉. We discuss the GL(n,K)-module structure of the quotient K〈X〉/Ip+1 for all p≥1 under the standard diagonal action. We give a bound on the values of partitions λ such that the irreducible GL(n,K)-module Vλ appears in the decomposition of K〈X〉/Ip+1 as a GL(n,K)-module. As an application, we take K=C and we consider the algebra of invariants (C〈X〉/Ip+1)G for G=SL(n,C), O(n,C), SO(n,C), or Sp(2s,C) (for n=2s). By a theorem of Domokos and Drensky, (C〈X〉/Ip+1)G is finitely generated. We give an upper bound on the degree of generators of (C〈X〉/Ip+1)G in a minimal generating set. In a similar way, we consider also the algebra of invariants (C〈X〉/Ip+1)G, where G=UT(n,C), and give an upper bound on the degree of generators in a minimal generating set. These results provide useful information about the invariants in C〈X〉G from the point of view of Classical Invariant Theory. In particular, for all G as above we give a criterion when a G-invariant of C〈X〉 belongs to Ip.