I think what you are looking for is **mixed code**.

A good start point would be [Brower--Hamalainen--Ostergard--Sloane](http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=651001). They are talking about mixed binary/ternary code, so for some $k$, $n_1=\cdots=n_k=2$ while $n_{k+1}=\cdots=n_N=3$.  Brouwer keep an [online list of known 2/3 mixed code](http://www.win.tue.nl/~aeb/codes/23codes.html).

I think they also talked about some general cases.  Anyway, more papers can be found from the references therein or by the key word.