According to this article, it originated in 18th century Switzerland as a means for farm families to stretch their limited resources during the winter months. With some remaining cheese and stale bread, and a dash of wine, the family could gather around the hearth. By dipping the bread in the melted cheese, the bread was softened and became delectable.