Two people have been rescued from their vehicles by firefighters using specialist equipment following a serious crash involving a car and a lorry.