You have to choose how you want to generalize the Heine-Borel property. There is no difficulty in generalizing "closed", because it already makes sense for any topological space, but "bounded" does not; it's specific to spaces with extra structure. So you have to choose how exactly you want to generalize that structure in interpreting the Heine-Borel property.
Since there are tempting generalizations of "bounded" where the Heine-Borel property need not hold (e.g. arbitrary metric spaces, with "$E$ is bounded" defined to mean something like "$E$ is contained in some ball of finite radius", need not have the Heine-Borel property), some care must taken in doing this.
One generalization is to work with complete metric spaces, and to replace the naive notion of boundedness just described with that of total boundedness. In this situation it is true that a subset $E$ of a complete metric space is compact if and only if it is closed and totally bounded. (If you want a Heine-Borel-type theorem for metric spaces that might not be complete, you can do this too--- at the cost of replacing "closed" with something relating to completeness. Wikipedia's page on this is informative; the details are also in most analysis books that discuss metric spaces in general. I'm not certain, but I think Rudin's Principles of Mathematical Analysis contains at least some of the details--- or maybe he sticks them in exercises.)
You can go slightly more general than metric spaces by considering uniform spaces (which have enough extra structure beyond just the topology to be able to talk about things like "uniform continuity", but do not necessarily have topologies induced by metrics). Total boundedness can be formulated for uniform spaces, too, and it's what you need (along with a technical condition related to completeness) to characterize compact sets in this situation.
Going in a slightly different direction, in functional analysis at least, it is quite common to have subsets of interest in infinite dimensional vector spaces that are simply not going to be compact or totally bounded in any natural structure that you want them to have these properties in, but you still want to exploit the idea of some kind of "boundedness". The generalized notion of a bornological space (roughly speaking, a topological space endowed with a collection of subsets that one regards as being "bounded") is occasionally useful in this connection, although I can't think of any nice Heine-Borel-type theorem at this level of generality.