Pseudo-effect algebras are partial algebras $(E;+,0,1)$ with a partially defined addition $+$ which is not necessarily commutative and therefore with two complements, left and right ones. General comparability allows to compare elements of $E$ in some intervals with Boolean ends. Such an algebra is always a pseudo MV-algebra. We show that it admits a state, and we describe the state space from the topological point of view. We prove that every pseudo-effect algebra is in fact a pseudo MV-algebra which is a subdirect product of linearly ordered pseudo-MV-algebras. In addition, we present many illustrating examples.