There is a notion of (divisor) class group 'Cl(X) ' associated to algebraic varieties X--affine and projective. (I will define this notion below for elliptic curves which are projective.). Now, if A is a Dedekind domain, (e.g. the ring of integers in a number field F (where F could be a quadratic field you are interested in) Cl(Spec(A)) coincides with the ideal class group of A as defined in Algebraic Number Theory. So, this gives you the connection between affine varieties and ideal class group. (Spec A is affine.)
I will now define Cl(X) for an elliptic curve X. . A divisor D of X is a linear combination of points x_i with coefficients k_i in Z(the integers).. The degree of D (deg D) is the sum of the k_i's. The divisors of X form a group Div(X)--the free Abelian group (Z-module) generated by the x_i's . A principal divisor is a divisor D such that the degree of D = 0.The principal divisors (P(X)) form a subgroup of Div (X) and the quotient group Div(X)/P(X) is denoted by Cl(X). Now, there is homomorphism deg: Cl(X) --> Z whose kernel is denoted by Cl^o(X). Cl^o(X) has the following interesting property:
There is a one-one correspondence between the points of x and the elements of the group Cl^o(X). Moreover by using this one-one correspondence, one can transfer the group law from Cl^o(X) to X itself.
Elliptic curves is a very active area of research probably because the curves have various deep ramifications. For example, an elliptic curve is an Abelian variety of dimension 1 i.e an irreducible projective algebraic group; it is also a curve of genus 1. etc.
for further information you may look at the following books:
1) Basic Algebraic Geometry--Varieties in Projective spaces by I. R. Shavarevich.
Springer-Verlag.
2) Algebraic Geometry-- R. Hartshorne. Springer-Verlag.