Let me explain quickly, where the the classicality assumption is made in the proof of Bell's theorem. For any four random variables ##A, B, C, D:\Lambda\rightarrow\{-1,1\}##, we have the inequality
$$\left|A(C+D)+B(C-D)\right|\leq 2 \text{.}$$
We can then easily derive an inequality between the correlations of these random variables.
$$\left|\left<AC\right>+\left<AD\right>+\left<BC\right>-\left<BD\right>\right|\leq 2 \text{.}$$
We see that this inequality holds whenever we have four such random variables. If we now put ##A=A_\alpha##, ##B=A_{\alpha^\prime}##, ##C=B_\beta## and ##D=B_{\beta^\prime}##, we get the CHSH inequality
$$\left|\left<A_\alpha B_\beta\right>+\left<A_\alpha B_{\beta^\prime}\right>+\left<A_{\alpha^\prime}B_\beta\right>-\left<A_{\alpha^\prime}B_{\beta^\prime}\right>\right|\leq 2 \text{.}$$
This is possible, because we have used exactly four random variables to derive it. One way to violate it is by introducing non-locality, such that we have ##8## combinations ##A_{\alpha\beta}##, ##A_{\alpha^\prime \beta}##, ##B_{\alpha\beta}##, ##\ldots## instead of just ##4##. Obviously, the derivation of the CHSH inequality is blocked this way and hence non-locality allows for a violation of the CHSH inequality.
Of course, there is also another way to violate the inequality by noting that in QM, you can never measure ##A_\alpha## and ##A_{\alpha^\prime}## simultaneously, because they correspond to incompatible observables (this is often discussed under the name counterfactual definiteness). Thus we need to introduce a dependence on the measurement context, i.e. we have observables ##A_\alpha^{\chi_1}##, ##A_\alpha^{\chi_2}##, ##\ldots## and so on. Again, we get more than ##4## random variables and hence the derivation of the CHSH inequality is blocked. Furthermore, we know from the Kochen-Specker theorem that such a contextuality is absolutely required if you want to reproduce the predictions of quantum mechanics in a classical description and hence, if you don't make your observables context dependent, you are excluding quantum theory right from the start, before you even state the locality assumptions ##A_{\alpha\beta}^{\chi}=A_{\alpha}^{\chi}##.
Proofs exist that the way quantum mechanics violates Bell's inequality, is of this sort and that the quantum way of violating the inequality is completely compatible with the EPR criterion, contrary to what zonde wants to make you believe.
You can only derive the CHSH inequality if you require
both counterfactual definiteness ##A_{\alpha\beta}^\chi = A_{\alpha\beta}##
and locality ##A_{\alpha\beta} = A_\alpha##.