First of all, we have to realize that the answer to this question can be very different in different societies. Different societies give different roles to elders. I will answer from the perspective of a person living in the United States.
I would say that there are two main ways in which the elderly can contribute to our society. First, the elderly can be a source of tangible help to us. There are a variety of ways in which this can be, most of which are based on the fact that the elderly generally do not have to work and therefore have more free time. Because the elderly have more free time, they can be of great help to family members living near them. If young parents need a break from taking care of their children, their own elderly parents can give them that break. If both parents in a family work and there is an emergency like a sick child needing to be picked up from school and cared for, elderly parents can help with this as well. Similarly, because the elderly have more free time, they can volunteer in ways that can help the community. As an example of this, my father, who is about to turn 77, volunteers in a “language lab” in which he helps immigrants learn English. By doing these sorts of things, elderly people can provide tangible benefits both to their own relatives and to unrelated people in their communities.
Second, the elderly can be a source of intangible help to us. The elderly have seen more than we have and often have the wisdom that comes of experience. They can help to give us perspective on things that are happening in our lives because they have experienced many of the same things. The elderly can also help to remind us of traditional ways and to help make sure that we do not lose sight of those traditions that can help us. In other words, they can help to provide continuity and stability for our society.
If the elderly could not contribute, our communities would be poorer places. We would have more tangible problems because we could not benefit from the help that they can give us because they have free time. Just as importantly, we would lack their wisdom and would presumably do more ill-advised things because we did not have them to help us.