The King and Queen, the Prince and Princess of Wales and other senior royals spoke with veterans as they left the service