A multi-million-pound scheme to transform a historic building and create low cost community housing for families in need is nearing completion.