Grate furnace with melting furnace