If i look at it most easy i would look at it in a diatonic way.
The best might be you search the web for an explanation.
I did the best i could, but i think it isn't really clear.
Also if you do know that already, don't be mad at me.
To me looking at it most easy, diatonic, means it is an A-major-scale, the B being the second mode of that scale, the E being the fivth.
If you build chords diatonic from a scale, you only use the notes the scale contains to build chords, and you only use chords from that scale.
For A-major these notes are:
A B C-sharp D E F-sharp G-sharp
(if unsure how any major scale looks like, which notes it contains, just use the C-major scale you should know. The notes in any other major scale have the same relation of full and half steps).
You could look at them more abstract as
I II III IV V VI VII
The diatonic chords build from a major scale are always.
I: major with major 7
II: minor with minor 7
III: minor with minor 7
IV: major with major 7
V: major with minor 7
VI: minor with minor 7
VII: minor with minor 7 and a flat 5; usually called a "diminished chord (or half-diminished, to be correct).
You got 3 major chords, 2 with a major 7, 1 with a minor 7
and
4 minor chords, one of the being dimished, all with a minor 7
So. If i look at an E-major and a B-minor7 diatonic, why do i think it should be in A-major?:
1) The B is the V of E.
The B chord you use is not a major chord, so it can't be in the key of E-major.
2) Again as you see in the list above an E-major chord could also be a IV chord.
But E is the IV of B, and the B chord you got is a minor.
It can't be in the key of B-major either.
3) E isn't the I chord and it is not the IV chord.
But E is the V of A-major and there would be a major chord.
B is the II of A-major, and as shown in the list the II is a minor chord.
You could now use other diatonic chords from the A-major scale.
Most you already found.
You would have : A-major major 7, B-minor, C-sharp-minor, D-major major 7, E-major minor 7, F-sharp minor, G-sharp diminished.
The E-major is the V of A, and the V tends (rather strongly) to go to the I (the A major chord), because there is a strong tension in the V chord.
But:
If you release the tension by going from the E (the V) to the A (the I), you will lose that mixture of "melancholy and happiness".
So: Try it, release to the A, if it really loses the feeling you like, you could try to "modulate" to another key, but keep the same structure
Making the B the V instead of the II, it would be a major chord.
It would be the V of E, and the II of E is an F-sharp. So try:
B major and F-sharp minor
The B-major as the V of E will release to E-major chord, so you are back in your chord progression of
E-major and B-minor
Mind you that in one key, the E-key, the E is a major with a major 7 (the I of the diatonic chords from the E-major-scale) , in the other key, the A-major, it is an E-major with a minor 7 (the V of the diatonic chords from an A-major-scale).
You could fiddle with that.
Also you could finally release to the A major chord.
I am not really good with "modulating from one key to another.
It sure makes sense to use chords which are to be found in both keys, the one you come from and the one you want to modulate too
(E and B you already got, both are in the C-major scale, you could modulate to that too. Or G-major)
I hope this might help a little bit, i fear it made it rather worse. If so: sorry for that.