To determine an interval, always count up from the bottom (lower) note. Imagine that's the root of a key, it doesn't matter what key it's actually in. It's simply the relationship between two specific notes.
You are talking inversions here, and there's a simple formula to calculate that. The rule of nine. As in, a third upside down becomes a sixth, a fourth becomes a fifth, a seventh becomes a second.
Then there's the enharmonic issue, which actually can't be seen as an issue. Only when listened to, generally out of context. As in hear C>D#. It could easily be a minor third, but here it's an augmented second. Rules for this (yes, some theory does have rules!) is that the letter names make the number, but then you have to work out if it's maj., min., dim. or aug.
Perfect intervals are 4th, 5th and octave. If they grow bigger by a semitone, they become augmented; shrink by a semitone, diminished. All others are maj,min, dim, or aug.
An example or two. C>E = maj3. C>Eb = m3. C>E# = aug3. C>Ebb = dim3. Note all are 3rds because all are C>E.
To help with your inversions, as in the question - E>C = m6. Eb>C = maj6. E#>C = dim6. Ebb>C = aug6. Be well aware that Ebb in this situation is not D, and E# is not F. C>F = P4, so F>C = P5. They stay perfect when inverted.