We study the convolution of compound negative binomial distributions with arbitrary parameters. The exact expression and also a random parameter representation are obtained. These results generalize some recent results in the literature. An application of these results to insurance mathematics is discussed. The sums of certain dependent compound Poisson variables are also studied. Using the connection between negative binomial and gamma distributions, we obtain a simple random parameter representation for the convolution of independent and weighted gamma variables with arbitrary parameters. Applications to the reliability of m-out-of-n:G systems and to the shortest path problem in graph theory are also discussed.