The sum of independent compound Poisson random variables is a widely used stochastic model in many economic applications, including non-life insurance, credit and operational risk management, and environmental sciences. In this article we generalize this model by introducing dependence among Poisson frequency variables through a latent random variable in a linear fashion, which can be translated as a common underlying risk factors affecting the frequencies of individual compound Poisson variables. Despite its natural interpretation, this generalization leads to a highly complicated model with no closed-form distribution function. For this dependent compound mixed Poisson sum with an arbitrary severity distribution, we obtain the Laplace transform and further develop a new recursive algorithm to efficiently compute the probability mass function, extending the well-known Panjer recursion. Furthermore, based on this recursion, we derive another recursive scheme to determine the capital allocation associated with the Conditional Tail Expectation, a popular risk management exercise. A numerical example is presented for the illustration of our findings.