Shostakovich wrote his first piano concerto in 1933 when he was 27 years old. He started out writing a concerto for solo trumpet, but then added a piano to the mix and made it a double concerto. Both soloists have the same significance in the work, but it is usually labeled a piano concerto. Pianists are like that (also, Shostakovich played piano himself).
There is a whole host of references to other classical works in this concerto. Beethoven of course, but also Haydn and an earlier work by the composer himself is musically mentioned.
The second piano concerto was written in 1957, in a totally different time. Shostakovich wrote it as a present for the nineteenth birthday of his son. A cheerful piece, more so than most of Shostakovich’s works.