As Qiaochu points out, the easiest example is to take the indiscrete topology on any set with at least two elements. Any indiscrete space is automatically compact, and any subspace of an indiscrete space is again indiscrete.
Of course, in some sense indiscrete spaces are too trivial. So here is a large family of $T_0$ (indeed, sober) examples. Let $A$ be a commutative ring. The prime spectrum of $A$ is the topological space $\operatorname{Spec} A$ whose points are the prime ideals of $A$, and the open subsets of $\operatorname{Spec} A$ are those of the form
$$D(I) = \{ \mathfrak{p} \in \operatorname{Spec} A : I \nsubseteq \mathfrak{p} \}$$
where $I$ is any ideal of $A$. It can be shown that any open subset of the form $D((f))$ for any element $f$ in $A$ is compact, and in general $D((f))$ will also be non-closed. For example, for $A = \mathbb{Z}$, the prime spectrum consists of the points
$$\{ (p) : p \text{ is a prime number} \} \cup \{ (0) \}$$
and the non-empty open subsets are those that contain all but finitely many of the ideals $(p)$. This is very nearly the cofinite topology, but $(0)$ is not a closed point in $\operatorname{Spec} \mathbb{Z}$. It is straightforward to verify that all the non-empty open subsets of $\operatorname{Spec} \mathbb{Z}$ are compact and dense.
We can even find $T_1$ examples: as hinted above, any infinite set with the cofinite topology will have the property that all its non-empty open subsets are compact and dense. Another source of $T_1$ examples is classical algebraic geometry: if $k$ is any algebraically closed field, then $\mathbb{A}^n (k)$ is the topological space whose points are $n$-tuples of elements of $k$, and the open subsets of $\mathbb{A}^n (k)$ are those of the form
$$D(I) = \{ (a_1, \ldots, a_n) \in \mathbb{A}^n (k) : \forall f \in I . f (a_1, \ldots, a_n) \ne 0 \}$$
where $I$ is any ideal of the polynomial ring $k[x_1, \ldots, x_n]$. Again, it can be shown that any non-empty open subset of the form $D((f))$ for any polynomial $f$ is compact and dense in $\mathbb{A}^n (k)$.