Abstract. We discuss the enumeration theory for flags in Eulerian partially ordered sets, emphasizing the two main geometric and algebraic examples, face posets of convex polytopes and regular CW -spheres, and Bruhat intervals in Coxeter groups. We review the two algebraic approaches to flag enumeration -one essentially as a quotient of the algebra of noncommutative symmetric functions and the other as a subalgebra of the algebra of quasisymmetric functions -and their relation via duality of Hopf algebras. One result is a direct expression for the Kazhdan-Lusztig polynomial of a Bruhat interval in terms of a new invariant, the complete cd-index. Finally, we summarize the theory of combinatorial Hopf algebras, which gives a unifying framework for the quasisymmetric generating functions developed here.Mathematics Subject Classification (2010). Primary 06A11; Secondary 05E05, 16T30, 20F55, 52B11.