Of course the result is not valid if we drop commutativity. For instance the algebra of all bounded operators on $\ell_2$ can serve as a counterexample.
Concerning having a unit,
Maximal ideals of commutative Banach algebras have codimension one.
Here is a proof under an extra assumption that a maximal ideal is closed.
According to Gamelin
Th. Gamelin, Uniform Algebras, Prentice-Hall, Englewood Cliffs, N. J., 1969.
p. 22, closed maximal non-modular ideals are precisely those subspaces of codimension 1 which contain the linear span of all $xy$ where $x,y\in A$ (let us denote this set by $A\cdot A$). Indeed, a proper closed ideal $J$ is modular if and only if $A\cdot A\not\subseteq J$. Note that any subspace $M$ containing $A\cdot A$ is an ideal, so $M$ is a closed maximal ideal if and only if it has codimension 1. Since maximal modular ideals are kernels of characters the result follows.
The case where $M$ is not closed. (Edit 19.08.2014) H. Garth Dales, basing on some observations from this discussion managed to answer the question in the remaining case where the maximal ideal is not closed. He kindly uploaded his answer to the arXiv, so that you can find it here.
Non-complete algebras. There exist non-complete, commutative and unital normed algebras with maximal ideals having infinite codimension, though. For instance the algebra of all entire functions on the complex plane endowed with the sup norm on the closed unit disc is such an example. (I learnt this example from H. G. Dales.) To see this, endow this algebra with (non-normable) topology by specifying a family of semi-norms:
$$p_r(f) = \sup_{|z|\leqslant r}|f(z)|\;\;\;(r>0).$$
Now, take the ideal $$J = \{f\mbox{ entire}\colon (\exists{n_0\in \mathbb{N}})(\forall n\geqslant n_0) (f(n)=0)\}.$$ This is a proper ideal not contained in the kernel of any point evaluation. One can prove that kernels of point evaluations are the only maximal ideals which are closed in this topology. Since this algebra is unital, $J$ has to be contained in some dense maximal ideal $M$. Consequently, $M$ has infinite codimension.
To supplement egreg's answer, here is a proof of the result they mentioned:
If $X$ is a completely regular space, then there is a natural bijection between points of the Stone-Cech compactification $\beta X$ and maximal ideals in $C(X)$.
For $f\in C(X)$, we will write $V(f)$ for $f^{-1}(\{0\})$. Given a point $x\in \beta X$, define $$M_x=\{f\in C(X):x\in\overline{V(f)}\}.$$ (Here and below, the overline denotes closure in $\beta X$, not closure in $X$.) I claim that $x\mapsto M_x$ is our desired bijection.
First, $M_x$ is a maximal ideal. It is clear that it is closed under multiplication by elements of $C(X)$. If $f,g\in M_x$, observe $V(f)\cap V(g)\subseteq V(f+g)$. We will show $x\in\overline{V(f)\cap V(g)}$ and hence $f+g\in M_x$.
So, suppose $x\not\in\overline{V(f)\cap V(g)}$. We can then choose a closed neighborhood $A$ of $x$ which is disjoint from $\overline{V(f)\cap V(g)}$ and a function $h:\beta X\to [0,1]$ which vanishes on $A$ and is $1$ on $\overline{V(f)\cap V(g)}$. Now consider $F=(f^2+h,g^2+h)$ as a function $X\to\mathbb{R}^2$. Observe that $F$ never vanishes, since when $f$ and $g$ both vanish, $h$ is $1$. Choose a continuous function $s:\mathbb{R}^2\setminus\{(0,0)\}\to [0,1]$ such that $s(a,0)=0$ for all $a$ and $s(0,b)=1$ for all $b$. Then $s\circ F$ extends continuously to a map $k:\beta X\to [0,1]$. Observe that $k=1$ on $V(f)\cap A$ and $k=0$ on $V(g)\cap A$. But $A$ is a neighborhood of $x$, so $x\in\overline{V(f)\cap A}$ and also $x\in\overline{V(g)\cap A}$. Thus by continuity, $k(x)=1$ and $k(x)=0$, which is a contradiction.
We have therefore shown that $M_x$ is an ideal. For maximality, suppose $f\in C(X)\setminus M_x$. Then $x\not\in\overline{V(f)}$, so as above we can choose $h:\beta X\to [0,1]$ which vanishes on a neighborhood of $x$ and is $1$ on $\overline{V(f)}$. Then $h|_X\in M_x$ since it vanishes on an entire neighborhood of $x$, and $h|_X+f^2$ vanishes nowhere on $X$. Thus $h|_X+f^2$ is a unit in $C(X)$ and thus the ideal generated by $M_x$ and $f$ is not proper. Since $f\not\in M_x$ was arbitrary, this shows $M_x$ is maximal.
Now I claim that for $x\neq y$, $M_x\neq M_y$. To prove this, choose $h:\beta X\to [0,1]$ vanishing on a closed neighborhood of $x$ but not vanishing at $y$. Then $h|_X\in M_x$ and $h|_X\not\in M_y$.
Finally, I claim that any maximal ideal $M\subset C(X)$ is equal to $M_x$ for some $x\in \beta X$. To prove this, let $Z=\{\overline{V(f)}:f\in M\}$. Note that $V(f)$ is nonempty for all $f\in M$ since $M$ cannot contain a unit, and also that $V(f)\cap V(g)\supseteq V(f^2+g^2)$. It follows that $Z$ has the finite intersection property, and so by compactness of $\beta X$ there is some $x\in \beta X$ which is in every element of $Z$. But this just means that $M\subseteq M_x$, and so by maximality of $M$, $M=M_x$.
As for prime ideals that are not maximal, there are a lot more possibilities and it is much harder to describe all of them. As mentioned in Max's answer, you can construct some using ultrafilters. In fact, instead of considering functions which are $0$ along an ultrafilter as he does, you can instead consider functions which converge to $0$ at a certain rate, and in this way you can obtain large nested collections of prime ideals. You can find the details of such a construction at this answer of mine, which constructs a chain of prime ideals in $C(X)$ which is order-isomorphic to $[0,\infty)$ from any element of $C(X)$ that is not locally constant.
Best Answer
This is related to this question. Maximal ideals in the algebra of continuously differentiable functions on [0,1]
In fact, by using the same method, we can prove that the maximal ideal space of $C^k[0,1]$ is $[0,1]$. The key point here is polynomials are dense in $C^k[0,1]$ for every integer $k$.