This sounds like raspberry beetle. The larvae (maggot like as you describe) of the raspberry beetle fee on the ripening fruit. They then fall to the ground and pupate - spending their winter in the soil at the base of the plants. In spring the beetles emerge and feed on hawthorn or apple flowers until the host plants come into flower They then lay their eggs on the raspberry flowers and then eat the fruit from the inside out.
You can lessen the problem by hoeing around the plants and exposing the pupae for the birds to eat. In order to break the cycle you may have to spray with a suitable spray for use on food crops- too late for this year but next year when the first fruit start to change colour. You would need to spray in the evening when bees are in their hives as some sprays can kill bees.