function add_custom_media_fields($form_fields, $post) {
    $form_fields['custom_field'] = array(
        'label' => 'Benutzerdefiniertes Feld',
        'input' => 'text',
        'value' => get_post_meta($post->ID, '_custom_field', true),
    );
    return $form_fields;
}
add_filter('attachment_fields_to_edit', 'add_custom_media_fields', 10, 2);

function save_custom_media_fields($post, $attachment) {
    update_post_meta($post['ID'], '_custom_field', $attachment['custom_field']);
    return $post;
}
add_filter('attachment_fields_to_save', 'save_custom_media_fields', 10, 2);