A cochain complex (C,u) is a graded Abelian group C with fixed differential u of degree 1. (I'll use d for `down' and u for `up'. Standard symbols are the `partial derivative' and `delta' symbols.)
We have cocycles and coboundaries and cohomology groups, just as before. A chain complex becomes a cochain complex if we reverse the indexing. Also, the functor Hom(*,G) for fixed G turns chain complexes into cochain complexes and vice versa. (If u is the image of d for this functor, then (us)c = s(dc) for c in C_(i+1) and s in C^i = Hom(C_i,G). Clearly uu = 0.) Put C* = Hom(C,G) and C^i = (C*)_i and H^i(C) = H_i(C*).
The pairing (s,c) -> sc on C^i × C_i induces a pairing H^i(C) × H_i(C) -> G. [Indeed, if s is a cocycle, that is, us = 0, and c is a boundary, say c = db, then sc = sdb = usb = 0, and if s is a coboundary, say s = ut and c is a cycle, then sc = utc = tdc = 0.]
Applying the functor Hom(*,R) where R is a ring, we obtain cohomology with a ring structure derived from that of R.
Let us first look at simplicial cohomology over R. Given a i-cochain a and a j-cochain b, we define the (i+j)-cochain a cup b by (a cup b)(v_0 ... v_(i+j)) = a(v_0 ... v_i) b(v_i ... v_(i+j)). Then cup is bilinear, associative, has unit element e in C^0 defined by ev = 1 for all v in C_0, and satisfies u(a cup b) = ua cup b + (-1)^i a cup ub for a in C^i. This cup product induces a product on the cohomology. [Indeed, if a and b are cocycles, then a cup b is a cocycle, and if moreover a or b is a coboundary, then a cup b is a coboundary.] The resulting structure is called the cohomology ring. If R is commutative, it satisfies the Grassmann property: a cup b = (-1)^(ij) b cup a. On the cochain complex this product was defined for ordered simplices, but in the cohomology ring the product is independent of vertex ordering and we find a cap product also in the cohomology of oriented simplices.
One can do the same in general, instead of only for simplicial cohomology, but this requires some more machinery.
The idea is that there is a map H*(X) tensor H*(Y) -> H*(X × Y) and composing this (for the case X = Y) with the map H*(X × X) -> H*(X) obtained from the diagonal map X -> X × X we obtain a bilinear multiplication on H*(X).
There is a construct very similar to the cap product which yields a product between homology and cohomology classes.
We do the simplicial case again. Given a j-cochain a and an (i+j)-chain v = v_0 ... v_(i+j), we define the i-chain a cap v by a cap v = a(v_i ... v_(i+j)) v_0 ... v_i. Now cap is bilinear, and associative in the sense that a cap (b cap v) = (a cup b) cap v, has unit element e, and satisfies d(a cap v) = (-1)^i (ua) cap v + a cap dv. This last relation implies that we have a pairing H^j (K;R) × H_(i+j) (K;R) -> H_i (K;R), and if f is a map then f_*(f^*a cap v) = a cap f_*v.