Does the same construction that yields $K$-vector spaces when $K$ is a field yield free $K$-modules when $K$ is a ring? Let $K$ be a field and let $K[X]$ be the ring of polynomials with coefficients in $K$. Let $L$ be some larger ring that contains $K$ and let
$$\varphi : K[X] \to L$$
be the homomorphism sending $X \mapsto \alpha$ for some $\alpha \in L$. Let $m(X)$ be the minimal polynomial of $\alpha$ over $K$, so that $\ker\varphi = (m(X))$, and then since $\varphi$ is a surjection, we have
$$K[X]/(m(X)) \cong L.$$
In this case we can consider $L$ as a $K$-vector space, but what if $K$ is not a field, but rather an arbitrary ring? Does the same construction yield a free $K$-module?
I can think of some examples in which this is the case. For instance, if $K = \Bbb Z$ then the map 
$$\varphi : \Bbb Z[X] \to \Bbb Z[\sqrt{D}]$$
for some square-free $D$ with $D \equiv 2, 3 \bmod 4$, has kernel $(X^2 - D)$ and so $\Bbb Z[X]/(X^2 - D) \cong \Bbb Z[\sqrt{D}]$. These are the rings of integers of the fields $\Bbb Q(\sqrt{D})$, and hence are free $\Bbb Z$-modules of rank $2$.
Are there any obvious non-examples?
 A: To give a more elaborate answer on your specific question:
Let $A \leq C$ be a ring extension, $C$ a domain. Let $b \in C$ be integral over $A$, e.g. there is a polynomial $0 \neq f \in A[X]$, s.t. $f$ is normalized and $f(b) = 0$.
Consider the subring $B := A[b]$, defined as the image of the ring homomorphism $\varphi : A[X] \to C, X \mapsto b$.
Suppose further, that $A$ is integrally closed meaning that if $K := Q(A)$, then the elements of $K$ that are integral over $A$ are exactly $A$ itself.
Then one can show, that $B$ is a free $A$-module, it needs some effort though.
First one shows the following

In the setting above, $b$ is integral over $A$ iff. $mipo_K$(b) $\in A[X]$.

So usually $mipo_k(b) \in K[X]$ but in this case it really is true, that the coefficients all lie in $A$. (This requires $A$ to be integrally closed!)
Given this, it indeed follows that $\ker \varphi = (f)$ where $f := mipo_K(b)$.
By definition of $f$ it follows that $(f) \subseteq \ker \varphi$.
Now take any $g \in \ker \varphi$. Given any representative $r$ of $g$ $\mod (f)$, one gets an equation $g = q\cdot f + r$ for some $q \in A[X]$.
Now one needs to be careful: $f$ being normalized gives an equation $X^n \equiv \sum_{k < n}{a_k X^k} \mod (f)$ (where $n = \deg f$) and using this one can choose $r$ to be of degree strictly less than $f$, exactly the same way one would conclude that over a field.
Now was $0 = g(b) = q(b)\cdot f(b) + r(b) = r(b)$ it follows that $r = 0$ as $f$ is by assumption the minimal polynomial of $b$ over $K$.
So one has $g = q\cdot f$ and therefore $g \in (f)$.
Therefore we still have $\ker \varphi = (f)$ in this case, and so $B \simeq A[X]/(f)$. As $(1,X,...,X^{n-1})$ are linearly independent over $K$ they are also linearly independent over $A$. They also generate $A[X]/(f)$ by the exact same argument we used to choose $r$ with $\deg r < \deg f$ and therefore $(1,...,X^{n-1})$ is of $A$-basis for $A[X]/(f)$, hence $(1,b,...,b^{n-1})$ is an $A$-basis of B.
//edit: You can find a proof of the cited lemma in Milnes notes "Algebraic Number Theory" Proposition. 2.11 (freely available on the homepage of Milne)
