I remember encountering the same question when teaching Operations Management for the first time.
The thing is, annual total inventory cost is simply total annual ordering cost plus total annual holding cost, all of them measured in $\frac{\\\$}{year}$. The total ordering costs is simple: number of orders per year times fixed cost per order: $\frac{D \, items/year}{Q \, items/order} \times K \frac{\\\$}{order} = \frac{\\\$}{year}$.
The total holding cost can be calculated as annual holding cost per item times average inventory level, which is measured in items and happens to be equal to $\frac{Q}{2}$. Usually, in textbooks they use continuous inventory depletion model, like in the picture below, and use the triangle area formula to explain the intuition.
However, in for more general settings the EOQ formula derivation is even less straightforward, and involves derivative and integration. To explain it in apples-to-apples manner you would have to go deep into mathematical realms, which defeats the whole purpose. I noticed that in textbooks, even the Master level ones, they drop the measurement units issue in discussion of EOQ, Newsvendor model and other nonlinear topics.
PS: If I remember correctly, in the undergraduate textbook I was using (Stevenson), $K$ was measured in just dollars.